package com.fzfnn.scrapbook.util;



/**
 * 统一响应状态码和提示信息
 */
public enum ResultCodeEnum {

    SUCCESS(0, "处理成功"),
    WARN(1, "操作警告"),
    ERROR(2, "系统异常"),

    // 可拓展业务场景码：
    PARAM_ERROR(1001, "参数错误"),
    LOGIN_FAIL(1002, "登录失败"),
    UNAUTHORIZED(1003, "无权限访问"),
    NOT_FOUND(1004, "资源不存在"),
    SERVER_ERROR(1005, "服务器内部错误");

    private final Integer code;
    private final String message;

    ResultCodeEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}
